﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace iChip.Hotspots.Models
{
    public class HotspotsObject
    {
        public HotspotsObject()
        {

        }
        public int Counter { get; set; }
        public int Hotspot_Id { get; set; }
        public string Hotspot_Name { get; set; }
        public string Hotspot_Mac { get; set; }
        public string Hotspot_Ip { get; set; }
        public string Hotspot_Nasid { get; set; }
        public string Hotspot_City { get; set; }
        public string Hotspot_Region { get; set; }
        public string Hotspot_Address { get; set; }
        public string Hotspot_Location { get; set; }
        public bool Hotspot_Status { get; set; }
        public string Hotspot_Type { get; set; }
        public int Brander_Id { get; set; }

    }

    public class MapObject
    {
        public MapObject()
        {

        }

        public string DisplayName { get; set; }
        public string Address { get; set; }
        public string GeoLong { get; set; }
        public string GeoLat { get; set; }
        public string Status { get; set; }
    }



    public class HotspotsModel
    {
        public HotspotsModel()
        {
            Hotspot_RegionList = new List<SelectListItem>();
            Hotspot_CityList = new List<SelectListItem>();
           
        }
        public int Hotspot_Id { get; set; }
        public int Account_Id { get; set; }
        [Required]
        [Display(Name = "Hotspots Name")]
        public string Hotspot_Name { get; set; }
        [Required]
        [Display(Name = "Hotspots Mac")]
        public string Hotspot_Mac { get; set; }
        [Required]
        [Display(Name = "Hotspots Ip")]
        public string Hotspot_Ip { get; set; }
        [Required]
        [Display(Name = "Hotspots Nasid")]
        public string Hotspot_Nasid { get; set; }
        public IEnumerable<SelectListItem> Hotspot_CityList { get; set; }  
        public IEnumerable<SelectListItem> Hotspot_RegionList { get; set; }
        public string Hotspot_City { get; set; }
        public string Hotspot_Address { get; set; }
        public string Hotspot_Region { get; set; }
        public string Hotspot_Long { get; set; }
        public string Hotspot_Lat { get; set; }  
        public bool Hotspot_Status { get; set; }
        [Required]
        [Display(Name = "Loại thiết bị")]
        public string Hotspot_Type { get; set; }        
        public string Hotspot_Location 
        {
            get
            {
                if (!string.IsNullOrEmpty(this.Hotspot_Long) && !string.IsNullOrEmpty(this.Hotspot_Lat))
                {
                    return this.Hotspot_Lat + "," + this.Hotspot_Long;
                }
                else
                {
                    return "0,0";
                }
            }
            //get
            //{
            //    if (string.IsNullOrEmpty(_hotsPost_Location))
            //    {
            //        _hotsPost_Location = this.Hotspot_Lat + "," + this.Hotspot_Long;
            //    }
            //    return _hotsPost_Location;
            //}
            //set
            //{
            //    if(!string.IsNullOrEmpty(this.Hotspot_Long) && !string.IsNullOrEmpty(this.Hotspot_Lat))
            //    {
            //        _hotsPost_Location = this.Hotspot_Long + "," + this.Hotspot_Lat;
            //    }
            //    else
            //    {
            //        _hotsPost_Location = value;
            //    }
            //}
        }
    }
}